package com.example.borui.partpositionproject.simple.adapter;

import android.content.Context;

import com.example.borui.partpositionproject.partpisition.adapter.BasePartPositionAdapter;
import com.example.borui.partpositionproject.partpisition.base.BasePartPosition;
import com.example.borui.partpositionproject.partpisition.base.IPartPositionView;
import com.example.borui.partpositionproject.partpisition.view.IPartPositionBean;
import com.example.borui.partpositionproject.simple.factory.PartPositionFactory;

/**
 * Created by borui on 2017/9/29.
 */
public class SimpleAdapter extends BasePartPositionAdapter {

    private IPartPositionView view;

    /**
     * 构造函数
     *
     * @param context
     */
    public SimpleAdapter(Context context, IPartPositionView view) {
        super(context);
        this.view = view;
    }

    @Override
    public BasePartPosition buildProcessor(int partPosition, IPartPositionBean bean) {
        return PartPositionFactory.builtBasePartPosition(mContext, partPosition, bean, view);
    }

    @Override
    public void onBindPartPosition(BasePartPosition basePartPosition, int partPosition, int position) {

    }

    @Override
    public String logName() {
        return "simpleAdapter";
    }

    @Override
    public int getItemViewType(int position) {
        int veiwType = super.getItemViewType(position);
        System.out.println(position + "  getItemViewType viewType = " + veiwType);
        return veiwType;
    }
}
